import { ResponseData, ResponseInfo } from "@/store/types";
import { StateTree, StoreActions, StoreGetters } from "pinia";

export declare interface writeState extends StateTree {
    component: {
        [key: string]: any
        placeholder: string
    }
    data: {
        [key: string]: any
        lineNumber: boolean
        tableShape: number[]
        showCodeRowNumber: boolean
    }
    form: Article
    imgUrlMap: Map<string, string>
}
export declare interface writeActions extends StoreActions<writeState> {
    _onSave: (v: string, h: Promise<string>) => void
    _onTip: () => void
    _onUploadImg: (files: File[], callback: (url: string[]) => void) => void
    _oninitForm: () => void
}
export declare interface writeGetters extends StoreGetters<writeState> {
}

export declare type Article = {
    title: string
    content: string
    description: string
    images: string[] // 图片地址
    cover: string
    views: number
    likes: number
    comments: number
    favorites: number
    shares: number
    categories: string[] // 分类
}

export declare type ArticleData = Article & ResponseData & { url: string }
export declare type ArticleInfo = ResponseInfo<ArticleData>